package com.ruoyi.express.service.impl;

import com.ruoyi.common.support.Convert;
import com.ruoyi.express.domain.BaiduApiToken;
import com.ruoyi.express.mapper.BaiduApiTokenMapper;
import com.ruoyi.express.service.IBaiduApiTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 百度开放平台token 服务层实现
 * 
 * @author ruoyi
 * @date 2019-03-09
 */
@Service
public class BaiduApiTokenServiceImpl implements IBaiduApiTokenService 
{
	@Autowired
	private BaiduApiTokenMapper baiduApiTokenMapper;

	/**
     * 查询百度开放平台token信息
     * 
     * @param tokenId 百度开放平台tokenID
     * @return 百度开放平台token信息
     */
    @Override
	public BaiduApiToken selectBaiduApiTokenById(Integer tokenId)
	{
	    return baiduApiTokenMapper.selectBaiduApiTokenById(tokenId);
	}
    @Override

	public BaiduApiToken selectBaiduApiTokenByClientId(String clientId)
	{
	    return baiduApiTokenMapper.selectBaiduApiTokenByClientId(clientId);
	}

	/**
     * 查询百度开放平台token列表
     * 
     * @param baiduApiToken 百度开放平台token信息
     * @return 百度开放平台token集合
     */
	@Override
	public List<BaiduApiToken> selectBaiduApiTokenList(BaiduApiToken baiduApiToken)
	{
	    return baiduApiTokenMapper.selectBaiduApiTokenList(baiduApiToken);
	}
	
    /**
     * 新增百度开放平台token
     * 
     * @param baiduApiToken 百度开放平台token信息
     * @return 结果
     */
	@Override
	public int insertBaiduApiToken(BaiduApiToken baiduApiToken)
	{
	    return baiduApiTokenMapper.insertBaiduApiToken(baiduApiToken);
	}
	
	/**
     * 修改百度开放平台token
     * 
     * @param baiduApiToken 百度开放平台token信息
     * @return 结果
     */
	@Override
	public int updateBaiduApiToken(BaiduApiToken baiduApiToken)
	{
	    return baiduApiTokenMapper.updateBaiduApiToken(baiduApiToken);
	}

	/**
     * 删除百度开放平台token对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteBaiduApiTokenByIds(String ids)
	{
		return baiduApiTokenMapper.deleteBaiduApiTokenByIds(Convert.toStrArray(ids));
	}
	
}
